function dispConnection(connectionType)
% FUNCTION DISPCONNECTION(CONNECTIONTYPE) displays postsynaptic traces in
% connectionType. This function can be used after running FINALSUMMARY.M.

for k = 1:length(connectionType)
    
    if connectionType(k).snRatio > 8
        figure
        subplot(211)
        plot(connectionType(1).XData,connectionType(k).YDatapre)
        subplot(212)
        plot(connectionType(1).XData,connectionType(k).YDatapost)
        hold on
        
        % refer to kineticsAnalysis.m
%         [spikePeak,Ipre] = max(ConnectionSp2Sp(k).YDatapre(2000:2100));
        f = @(x) connectionType(k).expAmp * exp((-x+0.2149)/(0.001 * connectionType(k).decayConstant))...
            + mean(connectionType(k).YDatapost(1000:1999));
        plot([0.21:0.0001:0.3],f(0.21:0.0001:0.3),'r')
    title([connectionType(k).name,' ',num2str(k)])
    pause
    end
end